There are tools for directly engaging and safely studying malware.

Sandbox

A sandbox is a secluded (isolated) environment either on a computer or as a separate computer, where untested code or malware can be run to study the results without having any ill effects on the rest of the software.

Dynamic analysis of malicious code has increasingly become an essential component of defense against internet threats. By executing malware samples in a controlled environment, it is possible to observe its malicious behavior, obtain its unpacked code, detect botnet command and control (C&C) servers, generate signatures for C&C traffic, as well as remediation procedures for malware infections.

Large-scale, dynamic malware analysis systems (DMAS) based on tools such as PeStudio and CWSandbox are operated by security researchers and companies. These services are available for free and are widespread in use by software developers, security analysts, and penetration testers, both ethical and unethical, around the world. Private malware analysis sandboxes are operated by a variety of security companies such as antivirus vendors.

As you might expect, a program executing inside a sandbox can perform fingerprinting operations on that environment, much like when running on any other host. Software vendors have legitimate reasons to protect their intellectual property from reverse engineering, and code packaging security tools like Themida for Windows can allow vendors to build code that immediately exits when it detects it is running in a reverse engineering or other type of sandbox. (The developer might also use this capability to issue a license violation warning notice to the user.) Naturally, malware builders can and often do incorporate similar features to protect their code from being reverse engineered.

Interactive Behavioral Testing

Interactive behavioral testing is a time-consuming process and is part of a more advanced reverse engineering process in most cases.

Take, for example, a malware that attempts to connect to a remote Internet Relay Chat (IRC) server. You can create a Linux virtual environment with Snort and an IRC server on the Linux box. You can then modify the HOSTS file of the Windows virtual machine to point to the IRC server for the domain requested by the malware. When the malware is run, it will be redirected to the internal Linux server and will attempt to log in to the IRC server. If properly configured, you can interact with the malware in the IRC server, trying out different commands and watching what it does when various conditions or commands change. The possibilities are almost endless on various virtual networks and solutions that can be implemented to test specific components of code within a laboratory environment.

Detecting and Responding to Malware

Some malware infections can be extremely difficult to detect. Malware authors continually adjust malware to avoid detection, and many rootkits are so buried in the core of the system that they cannot be detected by most antivirus products. However, it is possible to detect many malware infections by monitoring systems and network activities.

Malware will often consume CPU and network resources, run unauthorized processes on the system, congest bandwidth, or slow down system performance/response time. Malware may also cause unexplained changes to a system including default applications or browser settings.

Every organization should also deploy security tools such as firewalls and antivirus and antispam solutions. Real-time traffic should be examined on the network to detect malicious activity, and disk drives and endpoint devices should be scanned regularly to discover malware code that may have been installed.

Threats have become more complex and operationally sophisticated as the security marketplace has evolved. Many firms offer managed security services that an organization can use to get the optimal mix of in-house and third-party expertise, procedures, systems, sensors, data management and analytics, and incident response and recovery capabilities that are both needed and affordable.

Shopping for such services does mean that your organization needs its own security professionals to know, service by service, what may be involved in using it and how to determine how much or how little of it is needed. A short list of such services includes detection and prevention, containment, eradication, response, recovery, and after-action lessons-learned processes and systems improvement capabilities. These services can also help your organization establish more sophisticated threat intelligence measures, such as honeynets, honeypots, sandbox testing facilities, or more advanced behavioral analytics for users, entities, and suspected malware or potentially unwanted programs (PUPs).